< previous page page_391 next page >

Page 391
The RSDelete Routine
The RSDelete routine performs a delete operation on the selected data record. But before committing the deed, the user is given a chance to reverse the process. Add Listing 10.15 to the library.
Type.gifListing 10.15. Coding the RSDelete function.
Private Function RSDelete()
    '
    ' delete current record
    '
    Dim lngResult As Long
    '
    lngResult = MsgBox("Delete current record?", vbYesNo + vbQuestion, rs.Name)
    If lngResult = vbYes Then
        rs.Delete
    End If
    '
    RSDelete = 0
    Exit Function
    '
LocalErr:
    RSDelete = Err.Number
    '
End Function
Other Record Routines
You need three more routines to complete the record-handling portion of the library. RSClose handles the final closing of the record-handling routines; RSBack and RSNext provide a safe way to process Visual Basic MovePrevious and MoveNext operations without encountering end-of-file errors from Visual Basic. Add these three routines, which are provided in Listing 10.16, to the library.
Type.gifListing 10.16. Coding the RSClose, RSBack, and RSNext routines.
Public Sub RSClose()
    '
    ' close down object
    '
    Class_Terminate
    '
End Sub
continues

 
< previous page page_391 next page >

If you like this book, buy it!